const TYPES = {
  'cashier': '收银',
  'finance': '财务',
  'personnel': '人事',
  'attendance': '考勤'
}
export default {
  StoreOfficer: {
    entity: { name: 'Officer', prefix: () => `store/${localStorage.getItem('storeId')}` },
    list: {
      list_filter: {
        type: Object.assign({ __label: '类型' }, TYPES)
      },
      list_display: [
        { property: 'user', label: '用户' },
        {
          property: 'type',
          label: '类型',
          component: {
            props: ['data'],
            data() {
              return {
                types: TYPES
              }
            },
            render(h) {
              return <span>{this.types[this.data]}</span>
            }
          }
        },
        { property: 'enabled', label: '是否激活' }
      ]
    },
    form: {
      fields: [
        'user',
        'type',
        { property: 'enabled', default_value: true }
      ]
    }
  }
}

